<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>API: editor   toolbar.js  (YUI Library)</title>
	<link rel="stylesheet" type="text/css" href="assets/api.css">
    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">

	<div id="hd">
        <a href="http://developer.yahoo.com/yui/"><h1>Yahoo! UI Library</h1></a>
        <h3>editor&nbsp; <span class="subtitle">2.3.1</span></h3>
        <p>
        <a href="./index.html">Yahoo! UI Library</a> 
            &gt; <a href="./module_editor.html">editor</a>
                
                 &gt; toolbar.js (source view) 
            </p>

	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form name="yui-classopts-form">
    <span id="classopts"><input type="checkbox" name="showprivate" id="showprivate" /> Show Private</span>
    <span id="classopts"><input type="checkbox" name="showprotected" id="showprotected" /> Show Protected</span>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 #classopts { display:none; }
                        </style>
<div class="highlight" ><pre><span class="c">/*</span>
<span class="c">Copyright (c) 2007, Yahoo! Inc. All rights reserved.</span>
<span class="c">Code licensed under the BSD License:</span>
<span class="c">http://developer.yahoo.net/yui/license.txt</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c"> * @description &lt;p&gt;Creates a rich Toolbar widget based on Button. Primarily used with the Rich Text Editor&lt;/p&gt;</span>
<span class="c"> * @class Toolbar</span>
<span class="c"> * @namespace YAHOO.widget</span>
<span class="c"> * @requires yahoo, dom, element, event</span>
<span class="c"> * @optional container, menu, button, dragdrop</span>
<span class="c"> * @beta</span>
<span class="c"> */</span>
<span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
    <span class="c">/**</span>
<span class="c">    * @private</span>
<span class="c">    **/</span>
<span class="k">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Dom</span><span class="o">,</span>
    <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">,</span>
    <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">;</span>

    <span class="c">/**</span>
<span class="c">     * Provides a rich toolbar widget based on the button and menu widgets</span>
<span class="c">     * @constructor</span>
<span class="c">     * @param {String/HTMLElement} el The element to turn into a toolbar.</span>
<span class="c">     * @param {Object} attrs Object liternal containing configuration parameters.</span>
<span class="c">    */</span>
    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">attrs</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Toolbar Initalizing&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="nx">arguments</span><span class="o">.</span><span class="nx">length</span> <span class="o">+</span> <span class="s1">&#39; arguments passed to constructor&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
        
        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">arguments</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">).</span><span class="nx">nodeType</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">attrs</span> <span class="o">=</span> <span class="nx">el</span><span class="o">;</span>
        <span class="o">}</span>
        <span class="k">var</span> <span class="nx">local_attrs</span> <span class="o">=</span> <span class="o">(</span><span class="nx">attrs</span> <span class="o">||</span> <span class="o">{});</span>

        <span class="k">var</span> <span class="nx">oConfig</span> <span class="o">=</span> <span class="o">{</span>
            <span class="nx">element</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
            <span class="nx">attributes</span><span class="o">:</span> <span class="nx">local_attrs</span>
        <span class="o">};</span>
        
        
        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
        <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">).</span><span class="nx">nodeType</span><span class="o">)</span> <span class="o">{</span>  
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">el</span><span class="o">);</span>
        <span class="o">}</span>
        

        <span class="k">if</span> <span class="o">(!</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;No element defined, creating toolbar container&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">();</span>
            
            <span class="k">if</span> <span class="o">(</span><span class="nx">local_attrs</span><span class="o">.</span><span class="nx">container</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">local_attrs</span><span class="o">.</span><span class="nx">container</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Container found in config appending to it (&#39;</span> <span class="o">+</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">local_attrs</span><span class="o">.</span><span class="nx">container</span><span class="o">).</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">local_attrs</span><span class="o">.</span><span class="nx">container</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">}</span>
        

        <span class="k">if</span> <span class="o">(!</span><span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="o">((</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">el</span><span class="o">))</span> <span class="o">?</span> <span class="nx">el</span> <span class="o">:</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">generateId</span><span class="o">());</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;No element ID defined for toolbar container, creating..&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
        <span class="o">}</span>
        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Initing toolbar with id: &#39;</span> <span class="o">+</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
        
        <span class="k">var</span> <span class="nx">cont</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">cont</span> <span class="o">=</span> <span class="nx">cont</span><span class="o">;</span>
        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">cont</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-subcont&#39;</span><span class="o">);</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">cont</span><span class="o">);</span>
        
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">;</span>
        <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">.</span><span class="nx">id</span><span class="o">;</span>

        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">constructor</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="nx">oConfig</span><span class="o">.</span><span class="nx">attributes</span><span class="o">);</span>
         
    <span class="o">};</span>

    <span class="c">/**</span>
<span class="c">    * @method _addMenuClasses</span>
<span class="c">    * @private</span>
<span class="c">    * @description This method is called from Menu&#39;s renderEvent to add a few more classes to the menu items</span>
<span class="c">    * @param {String} ev The event that fired.</span>
<span class="c">    * @param {Array} na Array of event information.</span>
<span class="c">    * @param {Object} o Button config object. </span>
<span class="c">    */</span>

    <span class="k">function</span> <span class="nx">_addMenuClasses</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">na</span><span class="o">,</span> <span class="nx">o</span><span class="o">)</span> <span class="o">{</span>
        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-menu&#39;</span><span class="o">);</span>
        <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="nx">o</span><span class="o">.</span><span class="nx">_button</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-select&#39;</span><span class="o">))</span> <span class="o">{</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-select-menu&#39;</span><span class="o">);</span>
        <span class="o">}</span>
        <span class="k">var</span> <span class="nx">items</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getItems</span><span class="o">();</span>
        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">items</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span><span class="o">)</span> <span class="o">?</span> <span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">:</span> <span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()));</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">element</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-&#39;</span> <span class="o">+</span> <span class="nx">o</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="o">((</span><span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span><span class="o">)</span> <span class="o">?</span> <span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">)</span> <span class="o">:</span> <span class="nx">items</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">)));</span>
        <span class="o">}</span>
    <span class="o">}</span>

    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">extend</span><span class="o">(</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">,</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Element</span><span class="o">,</span> <span class="o">{</span>
        <span class="c">/** </span>
<span class="c">        * @property dd</span>
<span class="c">        * @description The DragDrop instance associated with the Toolbar</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">dd</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property _colorData</span>
<span class="c">        * @description Object reference containing colors hex and text values.</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_colorData</span><span class="o">:</span> <span class="o">{</span>
<span class="c">/* {{{ _colorData */</span>
    <span class="s1">&#39;#111111&#39;</span><span class="o">:</span> <span class="s1">&#39;Obsidian&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#2D2D2D&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#434343&#39;</span><span class="o">:</span> <span class="s1">&#39;Shale&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#5B5B5B&#39;</span><span class="o">:</span> <span class="s1">&#39;Flint&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#737373&#39;</span><span class="o">:</span> <span class="s1">&#39;Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8B8B8B&#39;</span><span class="o">:</span> <span class="s1">&#39;Concrete&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#A2A2A2&#39;</span><span class="o">:</span> <span class="s1">&#39;Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#B9B9B9&#39;</span><span class="o">:</span> <span class="s1">&#39;Titanium&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#000000&#39;</span><span class="o">:</span> <span class="s1">&#39;Black&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#D0D0D0&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#E6E6E6&#39;</span><span class="o">:</span> <span class="s1">&#39;Silver&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFFFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;White&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BFBF00&#39;</span><span class="o">:</span> <span class="s1">&#39;Pumpkin&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFFF00&#39;</span><span class="o">:</span> <span class="s1">&#39;Yellow&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFFF40&#39;</span><span class="o">:</span> <span class="s1">&#39;Banana&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFFF80&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Yellow&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFFFBF&#39;</span><span class="o">:</span> <span class="s1">&#39;Butter&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#525330&#39;</span><span class="o">:</span> <span class="s1">&#39;Raw Siena&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#898A49&#39;</span><span class="o">:</span> <span class="s1">&#39;Mildew&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#AEA945&#39;</span><span class="o">:</span> <span class="s1">&#39;Olive&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7F7F00&#39;</span><span class="o">:</span> <span class="s1">&#39;Paprika&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C3BE71&#39;</span><span class="o">:</span> <span class="s1">&#39;Earth&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#E0DCAA&#39;</span><span class="o">:</span> <span class="s1">&#39;Khaki&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FCFAE1&#39;</span><span class="o">:</span> <span class="s1">&#39;Cream&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#60BF00&#39;</span><span class="o">:</span> <span class="s1">&#39;Cactus&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#80FF00&#39;</span><span class="o">:</span> <span class="s1">&#39;Chartreuse&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#A0FF40&#39;</span><span class="o">:</span> <span class="s1">&#39;Green&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C0FF80&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Lime&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#DFFFBF&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Mint&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#3B5738&#39;</span><span class="o">:</span> <span class="s1">&#39;Green&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#668F5A&#39;</span><span class="o">:</span> <span class="s1">&#39;Lime Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7F9757&#39;</span><span class="o">:</span> <span class="s1">&#39;Yellow&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#407F00&#39;</span><span class="o">:</span> <span class="s1">&#39;Clover&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8A9B55&#39;</span><span class="o">:</span> <span class="s1">&#39;Pistachio&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#B7C296&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Jade&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#E6EBD5&#39;</span><span class="o">:</span> <span class="s1">&#39;Breakwater&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00BF00&#39;</span><span class="o">:</span> <span class="s1">&#39;Spring Frost&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00FF80&#39;</span><span class="o">:</span> <span class="s1">&#39;Pastel Green&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#40FFA0&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Emerald&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#80FFC0&#39;</span><span class="o">:</span> <span class="s1">&#39;Sea Foam&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BFFFDF&#39;</span><span class="o">:</span> <span class="s1">&#39;Sea Mist&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#033D21&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Forrest&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#438059&#39;</span><span class="o">:</span> <span class="s1">&#39;Moss&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7FA37C&#39;</span><span class="o">:</span> <span class="s1">&#39;Medium Green&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#007F40&#39;</span><span class="o">:</span> <span class="s1">&#39;Pine&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8DAE94&#39;</span><span class="o">:</span> <span class="s1">&#39;Yellow Gray Green&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#ACC6B5&#39;</span><span class="o">:</span> <span class="s1">&#39;Aqua Lung&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#DDEBE2&#39;</span><span class="o">:</span> <span class="s1">&#39;Sea Vapor&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00BFBF&#39;</span><span class="o">:</span> <span class="s1">&#39;Fog&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00FFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Cyan&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#40FFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Turquoise Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#80FFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Aqua&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BFFFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Cyan&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#033D3D&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Teal&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#347D7E&#39;</span><span class="o">:</span> <span class="s1">&#39;Gray Turquoise&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#609A9F&#39;</span><span class="o">:</span> <span class="s1">&#39;Green Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#007F7F&#39;</span><span class="o">:</span> <span class="s1">&#39;Seaweed&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#96BDC4&#39;</span><span class="o">:</span> <span class="s1">&#39;Green Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#B5D1D7&#39;</span><span class="o">:</span> <span class="s1">&#39;Soapstone&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#E2F1F4&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Turquoise&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#0060BF&#39;</span><span class="o">:</span> <span class="s1">&#39;Summer Sky&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#0080FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Sky Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#40A0FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Electric Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#80C0FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Azure&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BFDFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Ice Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#1B2C48&#39;</span><span class="o">:</span> <span class="s1">&#39;Navy&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#385376&#39;</span><span class="o">:</span> <span class="s1">&#39;Biscay&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#57708F&#39;</span><span class="o">:</span> <span class="s1">&#39;Dusty Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00407F&#39;</span><span class="o">:</span> <span class="s1">&#39;Sea Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7792AC&#39;</span><span class="o">:</span> <span class="s1">&#39;Sky Blue Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#A8BED1&#39;</span><span class="o">:</span> <span class="s1">&#39;Morning Sky&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#DEEBF6&#39;</span><span class="o">:</span> <span class="s1">&#39;Vapor&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#0000BF&#39;</span><span class="o">:</span> <span class="s1">&#39;Deep Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#0000FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#4040FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Cerulean Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8080FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Evening Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BFBFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#212143&#39;</span><span class="o">:</span> <span class="s1">&#39;Deep Indigo&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#373E68&#39;</span><span class="o">:</span> <span class="s1">&#39;Sea Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#444F75&#39;</span><span class="o">:</span> <span class="s1">&#39;Night Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#00007F&#39;</span><span class="o">:</span> <span class="s1">&#39;Indigo Blue&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#585E82&#39;</span><span class="o">:</span> <span class="s1">&#39;Dockside&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8687A4&#39;</span><span class="o">:</span> <span class="s1">&#39;Blue Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#D2D1E1&#39;</span><span class="o">:</span> <span class="s1">&#39;Light Blue Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#6000BF&#39;</span><span class="o">:</span> <span class="s1">&#39;Neon Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#8000FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Blue Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#A040FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Violet Purple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C080FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Violet Dusk&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#DFBFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Lavender&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#302449&#39;</span><span class="o">:</span> <span class="s1">&#39;Cool Shale&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#54466F&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Indigo&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#655A7F&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#40007F&#39;</span><span class="o">:</span> <span class="s1">&#39;Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#726284&#39;</span><span class="o">:</span> <span class="s1">&#39;Smoky Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#9E8FA9&#39;</span><span class="o">:</span> <span class="s1">&#39;Slate Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#DCD1DF&#39;</span><span class="o">:</span> <span class="s1">&#39;Violet White&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BF00BF&#39;</span><span class="o">:</span> <span class="s1">&#39;Royal Violet&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF00FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Fuchsia&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF40FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Magenta&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF80FF&#39;</span><span class="o">:</span> <span class="s1">&#39;Orchid&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFBFFF&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Magenta&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#4A234A&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Purple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#794A72&#39;</span><span class="o">:</span> <span class="s1">&#39;Medium Purple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#936386&#39;</span><span class="o">:</span> <span class="s1">&#39;Cool Granite&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7F007F&#39;</span><span class="o">:</span> <span class="s1">&#39;Purple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#9D7292&#39;</span><span class="o">:</span> <span class="s1">&#39;Purple Moon&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C0A0B6&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Purple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#ECDAE5&#39;</span><span class="o">:</span> <span class="s1">&#39;Pink Cloud&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BF005F&#39;</span><span class="o">:</span> <span class="s1">&#39;Hot Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF007F&#39;</span><span class="o">:</span> <span class="s1">&#39;Deep Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF409F&#39;</span><span class="o">:</span> <span class="s1">&#39;Grape&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF80BF&#39;</span><span class="o">:</span> <span class="s1">&#39;Electric Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFBFDF&#39;</span><span class="o">:</span> <span class="s1">&#39;Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#451528&#39;</span><span class="o">:</span> <span class="s1">&#39;Purple Red&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#823857&#39;</span><span class="o">:</span> <span class="s1">&#39;Purple Dino&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#A94A76&#39;</span><span class="o">:</span> <span class="s1">&#39;Purple Gray&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7F003F&#39;</span><span class="o">:</span> <span class="s1">&#39;Rose&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BC6F95&#39;</span><span class="o">:</span> <span class="s1">&#39;Antique Mauve&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#D8A5BB&#39;</span><span class="o">:</span> <span class="s1">&#39;Cool Marble&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#F7DDE9&#39;</span><span class="o">:</span> <span class="s1">&#39;Pink Granite&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C00000&#39;</span><span class="o">:</span> <span class="s1">&#39;Apple&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF0000&#39;</span><span class="o">:</span> <span class="s1">&#39;Fire Truck&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF4040&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Red&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF8080&#39;</span><span class="o">:</span> <span class="s1">&#39;Salmon&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFC0C0&#39;</span><span class="o">:</span> <span class="s1">&#39;Warm Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#441415&#39;</span><span class="o">:</span> <span class="s1">&#39;Sepia&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#82393C&#39;</span><span class="o">:</span> <span class="s1">&#39;Rust&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#AA4D4E&#39;</span><span class="o">:</span> <span class="s1">&#39;Brick&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#800000&#39;</span><span class="o">:</span> <span class="s1">&#39;Brick Red&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BC6E6E&#39;</span><span class="o">:</span> <span class="s1">&#39;Mauve&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#D8A3A4&#39;</span><span class="o">:</span> <span class="s1">&#39;Shrimp Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#F8DDDD&#39;</span><span class="o">:</span> <span class="s1">&#39;Shell Pink&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#BF5F00&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Orange&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF7F00&#39;</span><span class="o">:</span> <span class="s1">&#39;Orange&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FF9F40&#39;</span><span class="o">:</span> <span class="s1">&#39;Grapefruit&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFBF80&#39;</span><span class="o">:</span> <span class="s1">&#39;Canteloupe&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FFDFBF&#39;</span><span class="o">:</span> <span class="s1">&#39;Wax&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#482C1B&#39;</span><span class="o">:</span> <span class="s1">&#39;Dark Brick&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#855A40&#39;</span><span class="o">:</span> <span class="s1">&#39;Dirt&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#B27C51&#39;</span><span class="o">:</span> <span class="s1">&#39;Tan&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#7F3F00&#39;</span><span class="o">:</span> <span class="s1">&#39;Nutmeg&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#C49B71&#39;</span><span class="o">:</span> <span class="s1">&#39;Mustard&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#E1C4A8&#39;</span><span class="o">:</span> <span class="s1">&#39;Pale Tan&#39;</span><span class="o">,</span>
    <span class="s1">&#39;#FDEEE0&#39;</span><span class="o">:</span> <span class="s1">&#39;Marble&#39;</span>
<span class="c">/* }}} */</span>
        <span class="o">},</span>
        <span class="c">/** </span>
<span class="c">        * @property _colorPicker</span>
<span class="c">        * @description The HTML Element containing the colorPicker</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_colorPicker</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property STR_COLLAPSE</span>
<span class="c">        * @description String for Toolbar Collapse Button</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_COLLAPSE</span><span class="o">:</span> <span class="s1">&#39;Collapse Toolbar&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property STR_SPIN_LABEL</span>
<span class="c">        * @description String for spinbutton dynamic label. Note the {VALUE} will be replaced with YAHOO.lang.substitute</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_SPIN_LABEL</span><span class="o">:</span> <span class="s1">&#39;Spin Button with value {VALUE}. Use Control Shift Up Arrow and Control Shift Down arrow keys to increase or decrease the value.&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property STR_SPIN_UP</span>
<span class="c">        * @description String for spinbutton up</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_SPIN_UP</span><span class="o">:</span> <span class="s1">&#39;Click to increase the value of this input&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property STR_SPIN_DOWN</span>
<span class="c">        * @description String for spinbutton down</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">STR_SPIN_DOWN</span><span class="o">:</span> <span class="s1">&#39;Click to decrease the value of this input&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property _titlebar</span>
<span class="c">        * @description Object reference to the titlebar</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_titlebar</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property _disabled</span>
<span class="c">        * @description Object to track button status when enabling/disabling the toolbar</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_disabled</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @property browser</span>
<span class="c">        * @description Standard browser detection</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">browser</span><span class="o">:</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">env</span><span class="o">.</span><span class="nx">ua</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property _buttonList</span>
<span class="c">        * @description Internal property list of current buttons in the toolbar</span>
<span class="c">        * @type Array</span>
<span class="c">        */</span>
        <span class="nx">_buttonList</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property _buttonGroupList</span>
<span class="c">        * @description Internal property list of current button groups in the toolbar</span>
<span class="c">        * @type Array</span>
<span class="c">        */</span>
        <span class="nx">_buttonGroupList</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property _sep</span>
<span class="c">        * @description Internal reference to the separator HTML Element for cloning</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_sep</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property _sepCount</span>
<span class="c">        * @description Internal refernce for counting separators, so we can give them a useful class name for styling</span>
<span class="c">        * @type Number</span>
<span class="c">        */</span>
        <span class="nx">_sepCount</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property draghandle</span>
<span class="c">        * @type HTMLElement</span>
<span class="c">        */</span>
        <span class="nx">_dragHandle</span><span class="o">:</span> <span class="kc">null</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property _toolbarConfigs</span>
<span class="c">        * @type Object</span>
<span class="c">        */</span>
        <span class="nx">_toolbarConfigs</span><span class="o">:</span> <span class="o">{</span>
            <span class="nx">renderer</span><span class="o">:</span> <span class="kc">true</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_CONTAINER</span>
<span class="c">        * @description Default CSS class to apply to the toolbar container element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_CONTAINER</span><span class="o">:</span> <span class="s1">&#39;yui-toolbar-container&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_DRAGHANDLE</span>
<span class="c">        * @description Default CSS class to apply to the toolbar&#39;s drag handle element</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_DRAGHANDLE</span><span class="o">:</span> <span class="s1">&#39;yui-toolbar-draghandle&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_SEPARATOR</span>
<span class="c">        * @description Default CSS class to apply to all separators in the toolbar</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_SEPARATOR</span><span class="o">:</span> <span class="s1">&#39;yui-toolbar-separator&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_DISABLED</span>
<span class="c">        * @description Default CSS class to apply when the toolbar is disabled</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_DISABLED</span><span class="o">:</span> <span class="s1">&#39;yui-toolbar-disabled&#39;</span><span class="o">,</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @property CLASS_PREFIX</span>
<span class="c">        * @description Default prefix for dynamically created class names</span>
<span class="c">        * @type String</span>
<span class="c">        */</span>
        <span class="nx">CLASS_PREFIX</span><span class="o">:</span> <span class="s1">&#39;yui-toolbar&#39;</span><span class="o">,</span>
        <span class="c">/** </span>
<span class="c">        * @method init</span>
<span class="c">        * @description The Toolbar class&#39;s initialization method</span>
<span class="c">        */</span>
        <span class="nx">init</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">init</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">p_oElement</span><span class="o">,</span> <span class="nx">p_oAttributes</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method initAttributes</span>
<span class="c">        * @description Initializes all of the configuration attributes used to create </span>
<span class="c">        * the toolbar.</span>
<span class="c">        * @param {Object} attr Object literal specifying a set of </span>
<span class="c">        * configuration attributes used to create the toolbar.</span>
<span class="c">        */</span>
        <span class="nx">initAttributes</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">attr</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Toolbar</span><span class="o">.</span><span class="nx">superclass</span><span class="o">.</span><span class="nx">initAttributes</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">attr</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_CONTAINER</span><span class="o">);</span>


            <span class="c">/**</span>
<span class="c">            * @attribute buttons</span>
<span class="c">            * @description Object specifying the buttons to include in the toolbar</span>
<span class="c">            * Example:</span>
<span class="c">            * &lt;code&gt;&lt;pre&gt;</span>
<span class="c">            * {</span>
<span class="c">            *   { id: &#39;b3&#39;, type: &#39;button&#39;, label: &#39;Underline&#39;, value: &#39;underline&#39; },</span>
<span class="c">            *   { type: &#39;separator&#39; },</span>
<span class="c">            *   { id: &#39;b4&#39;, type: &#39;menu&#39;, label: &#39;Align&#39;, value: &#39;align&#39;,</span>
<span class="c">            *       menu: [</span>
<span class="c">            *           { text: &quot;Left&quot;, value: &#39;alignleft&#39; },</span>
<span class="c">            *           { text: &quot;Center&quot;, value: &#39;aligncenter&#39; },</span>
<span class="c">            *           { text: &quot;Right&quot;, value: &#39;alignright&#39; }</span>
<span class="c">            *       ]</span>
<span class="c">            *   }</span>
<span class="c">            * }</span>
<span class="c">            * &lt;/pre&gt;&lt;/code&gt;</span>
<span class="c">            * @type Array</span>
<span class="c">            */</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;buttons&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="o">[],</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">data</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">data</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">data</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">data</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;separator&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">addSeparator</span><span class="o">();</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">data</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">group</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">addButtonGroup</span><span class="o">(</span><span class="nx">data</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">addButton</span><span class="o">(</span><span class="nx">data</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute disabled</span>
<span class="c">            * @description Boolean indicating if the toolbar should be disabled. It will also disable the draggable attribute if it is on.</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">)</span> <span class="o">===</span> <span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span> <span class="o">=</span> <span class="o">{};</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_DISABLED</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;draggable&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_DISABLED</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">draggable</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                            <span class="c">//Draggable by default, set it back</span>
<span class="c"></span>                            <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;draggable&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                            <span class="c">//If it&#39;s already disabled, flag it</span>
<span class="c"></span>                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">));</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="c">//Check to see if it was disabled by default and skip it</span>
<span class="c"></span>                            <span class="k">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                            <span class="k">var</span> <span class="nx">_check</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">disabled</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">===</span> <span class="kc">true</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_check</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                            <span class="o">}</span>
                            <span class="k">if</span> <span class="o">(!</span><span class="nx">_check</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">));</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_disabled</span> <span class="o">=</span> <span class="o">{};</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute cont</span>
<span class="c">            * @description The container for the toolbar.</span>
<span class="c">            * @type HTMLElement</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">cont</span><span class="o">,</span>
                <span class="nx">readOnly</span><span class="o">:</span> <span class="kc">true</span>
            <span class="o">});</span>


            <span class="c">/**</span>
<span class="c">            * @attribute grouplabels</span>
<span class="c">            * @description Boolean indicating if the toolbar should show the group label&#39;s text string.</span>
<span class="c">            * @default true</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;grouplabels&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="nx">attr</span><span class="o">.</span><span class="nx">grouplabels</span> <span class="o">||</span> <span class="kc">true</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">grouplabels</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">grouplabels</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">),</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-nogrouplabels&#39;</span><span class="o">));</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">),</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-nogrouplabels&#39;</span><span class="o">));</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>
            <span class="c">/**</span>
<span class="c">            * @attribute titlebar</span>
<span class="c">            * @description Boolean indicating if the toolbar should have a titlebar. If</span>
<span class="c">            * passed a string, it will use that as the titlebar text</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean or String</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;titlebar&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">titlebar</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">titlebar</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-titlebar&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">titlebar</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">h2</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h2&#39;</span><span class="o">);</span>
                            <span class="nx">h2</span><span class="o">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="s1">&#39;-1&#39;</span><span class="o">;</span>
                            <span class="nx">h2</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">titlebar</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">h2</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">));</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>


            <span class="c">/**</span>
<span class="c">            * @attribute collapse</span>
<span class="c">            * @description Boolean indicating if the the titlebar should have a collapse button.</span>
<span class="c">            * The collapse button will not remove the toolbar, it will minimize it to the titlebar</span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">collapse</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">collapseEl</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">,</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">collapse</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="m">0</span><span class="o">)</span> <span class="o">{</span>
                            <span class="c">//There is already a collapse button</span>
<span class="c"></span>                            <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="nx">collapseEl</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;SPAN&#39;</span><span class="o">);</span>
                        <span class="nx">collapseEl</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;X&#39;</span><span class="o">;</span>
                        <span class="nx">collapseEl</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_COLLAPSE</span><span class="o">;</span>

                        <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">collapseEl</span><span class="o">,</span> <span class="s1">&#39;collapse&#39;</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">collapseEl</span><span class="o">);</span>
                        <span class="nx">Event</span><span class="o">.</span><span class="nx">addListener</span><span class="o">(</span><span class="nx">collapseEl</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-container-collapsed&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span> <span class="c">//Expand Toolbar</span>
<span class="c"></span>                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">collapse</span><span class="o">();</span> <span class="c">//Collapse Toolbar</span>
<span class="c"></span>                            <span class="o">}</span>
                        <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">collapseEl</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">,</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">collapseEl</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-container-collapsed&#39;</span><span class="o">))</span> <span class="o">{</span>
                                <span class="c">//We are closed, reopen the titlebar..</span>
<span class="c"></span>                                <span class="k">this</span><span class="o">.</span><span class="nx">collapse</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span> <span class="c">//Expand Toolbar</span>
<span class="c"></span>                            <span class="o">}</span>
                            <span class="nx">collapseEl</span><span class="o">[</span><span class="m">0</span><span class="o">].</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">collapseEl</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">});</span>

            <span class="c">/**</span>
<span class="c">            * @attribute draggable</span>
<span class="c">            * @description Boolean indicating if the toolbar should be draggable.  </span>
<span class="c">            * @default false</span>
<span class="c">            * @type Boolean</span>
<span class="c">            */</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">setAttributeConfig</span><span class="o">(</span><span class="s1">&#39;draggable&#39;</span><span class="o">,</span> <span class="o">{</span>
                <span class="nx">value</span><span class="o">:</span> <span class="o">(</span><span class="nx">attr</span><span class="o">.</span><span class="nx">draggable</span> <span class="o">||</span> <span class="kc">false</span><span class="o">),</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">draggable</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>

                    <span class="k">if</span> <span class="o">(</span><span class="nx">draggable</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;titlebar&#39;</span><span class="o">))</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Dragging enabled&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;SPAN&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;|&#39;</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">.</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="s1">&#39;Click to drag the toolbar&#39;</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;_draghandle&#39;</span><span class="o">;</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_DRAGHANDLE</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">hasChildNodes</span><span class="o">())</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">insertBefore</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">firstChild</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">);</span>
                            <span class="o">}</span>
                            <span class="c">/**</span>
<span class="c">                            * @property dd</span>
<span class="c">                            * @description The DragDrop instance associated with the Toolbar</span>
<span class="c">                            * @type Object</span>
<span class="c">                            */</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">dd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DD</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">));</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">setHandleElId</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
                            
                        <span class="o">}</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Dragging disabled&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span><span class="o">);</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_dragHandle</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">dd</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">draggable</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">dd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DD</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">));</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">setHandleElId</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">,</span> <span class="s1">&#39;draggable&#39;</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">,</span> <span class="s1">&#39;draggable&#39;</span><span class="o">);</span>
                            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">dd</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">dd</span><span class="o">.</span><span class="nx">unreg</span><span class="o">();</span>
                                <span class="k">this</span><span class="o">.</span><span class="nx">dd</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">},</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">ret</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">DD</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">ret</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                    <span class="k">return</span> <span class="nx">ret</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">});</span>

        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method addButtonGroup</span>
<span class="c">        * @description Add a new button group to the toolbar. (uses addButton)</span>
<span class="c">        * @param {Object} oGroup Object literal reference to the Groups Config (contains an array of button configs)</span>
<span class="c">        */</span>
        <span class="nx">addButtonGroup</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">oGroup</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;addButtonGroup&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">hasClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-grouped&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-grouped&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">div</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;DIV&#39;</span><span class="o">);</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">div</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-group&#39;</span><span class="o">);</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">div</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-group-&#39;</span> <span class="o">+</span> <span class="nx">oGroup</span><span class="o">.</span><span class="nx">group</span><span class="o">);</span>
            <span class="c">//if (oGroup.label &amp;&amp; this.get(&#39;grouplabels&#39;)) {</span>
<span class="c"></span>            <span class="k">if</span> <span class="o">(</span><span class="nx">oGroup</span><span class="o">.</span><span class="k">label</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="k">label</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;h3&#39;</span><span class="o">);</span>
                <span class="k">label</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">oGroup</span><span class="o">.</span><span class="k">label</span><span class="o">;</span>
                <span class="nx">div</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="k">label</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;grouplabels&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">),</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span><span class="o">,</span> <span class="s1">&#39;-nogrouplabels&#39;</span><span class="o">);</span>
            <span class="o">}</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">div</span><span class="o">);</span>

            <span class="c">//For accessibility, let&#39;s put all of the group buttons in an Unordered List</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">ul</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;ul&#39;</span><span class="o">);</span>
            <span class="nx">div</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">ul</span><span class="o">);</span>

            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonGroupList</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_buttonGroupList</span> <span class="o">=</span> <span class="o">{};</span>
            <span class="o">}</span>
            
            <span class="k">this</span><span class="o">.</span><span class="nx">_buttonGroupList</span><span class="o">[</span><span class="nx">oGroup</span><span class="o">.</span><span class="nx">group</span><span class="o">]</span> <span class="o">=</span> <span class="nx">ul</span><span class="o">;</span>

            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">oGroup</span><span class="o">.</span><span class="nx">buttons</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">li</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
                <span class="nx">li</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-groupitem&#39;</span><span class="o">;</span>
                <span class="nx">ul</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">li</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">((</span><span class="nx">oGroup</span><span class="o">.</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">type</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oGroup</span><span class="o">.</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;separator&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">addSeparator</span><span class="o">(</span><span class="nx">li</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">oGroup</span><span class="o">.</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">container</span> <span class="o">=</span> <span class="nx">li</span><span class="o">;</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">addButton</span><span class="o">(</span><span class="nx">oGroup</span><span class="o">.</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method addButtonToGroup</span>
<span class="c">        * @description Add a new button to a toolbar group. Buttons supported:</span>
<span class="c">        *   push, split, menu, select, color, spin</span>
<span class="c">        * @param {Object} oButton Object literal reference to the Button&#39;s Config</span>
<span class="c">        * @param {String} group The Group identifier passed into the initial config</span>
<span class="c">        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.</span>
<span class="c">        */</span>
        <span class="nx">addButtonToGroup</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">oButton</span><span class="o">,</span> <span class="nx">group</span><span class="o">,</span> <span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">groupCont</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonGroupList</span><span class="o">[</span><span class="nx">group</span><span class="o">];</span>
            <span class="k">var</span> <span class="nx">li</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;li&#39;</span><span class="o">);</span>
            <span class="nx">li</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-groupitem&#39;</span><span class="o">;</span>
            <span class="nx">oButton</span><span class="o">.</span><span class="nx">container</span> <span class="o">=</span> <span class="nx">li</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">addButton</span><span class="o">(</span><span class="nx">oButton</span><span class="o">,</span> <span class="nx">after</span><span class="o">);</span>
            <span class="nx">groupCont</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">li</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method addButton</span>
<span class="c">        * @description Add a new button to the toolbar. Buttons supported:</span>
<span class="c">        *   push, split, menu, select, color, spin</span>
<span class="c">        * @param {Object} oButton Object literal reference to the Button&#39;s Config</span>
<span class="c">        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.</span>
<span class="c">        */</span>
        <span class="nx">addButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">oButton</span><span class="o">,</span> <span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;addButton&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span> <span class="o">=</span> <span class="o">[];</span>
            <span class="o">}</span>
            <span class="c">//Add to .get(&#39;buttons&#39;) manually</span>
<span class="c"></span>            <span class="k">this</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">buttons</span><span class="o">.</span><span class="nx">value</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">buttons</span><span class="o">.</span><span class="nx">value</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">;</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Adding button of type: &#39;</span> <span class="o">+</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">container</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">oButton</span><span class="o">.</span><span class="nx">container</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">);</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">((</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;menu&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;split&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;select&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">var</span> <span class="nx">funcObject</span> <span class="o">=</span> <span class="o">{</span>
                                <span class="nx">fn</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">x</span><span class="o">,</span> <span class="nx">oMenu</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">if</span> <span class="o">(!</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">)</span> <span class="o">{</span>
                                        <span class="nx">oButton</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                                    <span class="o">}</span>
                                    <span class="nx">oButton</span><span class="o">.</span><span class="nx">value</span> <span class="o">=</span> <span class="o">((</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">?</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">value</span> <span class="o">:</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">);</span>
                                    <span class="c">//This line made Opera fire the click event and the mousedown,</span>
<span class="c"></span>                                    <span class="c">//  so events for menus where firing twice.</span>
<span class="c"></span>                                    <span class="c">//this._buttonClick(&#39;click&#39;, oButton);</span>
<span class="c"></span>                                <span class="o">},</span>
                                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span>
                            <span class="o">};</span>
                            <span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">onclick</span> <span class="o">=</span> <span class="nx">funcObject</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">_oButton</span> <span class="o">=</span> <span class="o">{};</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">o</span> <span class="k">in</span> <span class="nx">oButton</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="nx">oButton</span><span class="o">,</span> <span class="nx">o</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_toolbarConfigs</span><span class="o">[</span><span class="nx">o</span><span class="o">])</span> <span class="o">{</span>
                        <span class="nx">_oButton</span><span class="o">[</span><span class="nx">o</span><span class="o">]</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">[</span><span class="nx">o</span><span class="o">];</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;select&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;menu&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;spin&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;push&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">_oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;color&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">_oButton</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_makeColorButton</span><span class="o">(</span><span class="nx">_oButton</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">showEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_button</span> <span class="o">=</span> <span class="nx">_oButton</span><span class="o">;</span>
                    <span class="o">});</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">m</span> <span class="o">&lt;</span> <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">m</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">text</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">_oButton</span><span class="o">.</span><span class="nx">focusmenu</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">tmp</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">(</span><span class="nx">_oButton</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="c">//Toolbar is disabled, disable the new button too!</span>
<span class="c"></span>                <span class="nx">tmp</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">oButton</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Button created (&#39;</span> <span class="o">+</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s1">&#39;)&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
            
            <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">nextSib</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">.</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">nextSib</span> <span class="o">=</span> <span class="nx">after</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">nextSibling</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">nextSib</span> <span class="o">=</span> <span class="nx">after</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">nextSib</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">nextSib</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">el</span><span class="o">,</span> <span class="nx">nextSib</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="nx">tmp</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">));</span>
            <span class="k">var</span> <span class="nx">icon</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;span&#39;</span><span class="o">);</span>
            <span class="nx">icon</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-icon&#39;</span><span class="o">;</span>
            <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">icon</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;firstChild&#39;</span><span class="o">));</span>
            <span class="c">//Replace the Button HTML Element with an a href</span>
<span class="c"></span>            <span class="k">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
            <span class="nx">a</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">_button</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
            <span class="nx">a</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span><span class="o">;</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">a</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">});</span>
            <span class="nx">tmp</span><span class="o">.</span><span class="nx">_button</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">replaceChild</span><span class="o">(</span><span class="nx">a</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">_button</span><span class="o">);</span>
            <span class="nx">tmp</span><span class="o">.</span><span class="nx">_button</span> <span class="o">=</span> <span class="nx">a</span><span class="o">;</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;select&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">tmp</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-select&#39;</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;spin&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">range</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">oButton</span><span class="o">.</span><span class="nx">range</span> <span class="o">=</span> <span class="o">[</span> <span class="m">10</span><span class="o">,</span> <span class="m">100</span> <span class="o">];</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_makeSpinButton</span><span class="o">(</span><span class="nx">tmp</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">);</span>
            <span class="o">}</span>

            <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">setAttribute</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">));</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">!=</span> <span class="s1">&#39;spin&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">showPicker</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">exec</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">9</span><span class="o">))</span> <span class="o">{</span>
                            <span class="nx">exec</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">exec</span><span class="o">)</span> <span class="o">{</span>
                            <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">_button</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                            <span class="k">var</span> <span class="nx">menuEL</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">element</span><span class="o">;</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">menuEL</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">visibility</span> <span class="o">==</span> <span class="s1">&#39;hidden&#39;</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">show</span><span class="o">();</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">hide</span><span class="o">();</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">};</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="nx">showPicker</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;keydown&#39;</span><span class="o">,</span> <span class="nx">showPicker</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                    
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">!=</span> <span class="s1">&#39;menu&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">!=</span> <span class="s1">&#39;select&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;keypress&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonClick</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_buttonClick</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">);</span>
                    <span class="o">},</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">});</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="c">//Stop the mousedown event so we can trap the selection in the editor!</span>
<span class="c"></span>                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">});</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                    <span class="o">});</span>
                    <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">;</span>
                    <span class="c">//Hijack the mousedown event in the menu and make it fire a button click..</span>
<span class="c"></span>                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">mouseDownEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">args</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;mouseDownEvent&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                        <span class="k">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="nx">args</span><span class="o">[</span><span class="m">1</span><span class="o">];</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                        <span class="nx">tmp</span><span class="o">.</span><span class="nx">_onMenuClick</span><span class="o">(</span><span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="nx">tmp</span><span class="o">);</span>
                        <span class="k">if</span> <span class="o">(!</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menucmd</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">oButton</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                        <span class="o">}</span>
                        <span class="nx">oButton</span><span class="o">.</span><span class="nx">value</span> <span class="o">=</span> <span class="o">((</span><span class="nx">oMenu</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">?</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">value</span> <span class="o">:</span> <span class="nx">oMenu</span><span class="o">.</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span><span class="o">);</span>
                        <span class="nx">self</span><span class="o">.</span><span class="nx">_buttonClick</span><span class="o">.</span><span class="nx">call</span><span class="o">(</span><span class="nx">self</span><span class="o">,</span> <span class="nx">args</span><span class="o">[</span><span class="m">1</span><span class="o">],</span> <span class="nx">oButton</span><span class="o">);</span>
                        <span class="nx">tmp</span><span class="o">.</span><span class="nx">_hideMenu</span><span class="o">();</span>
                        <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">});</span>
                    <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">clickEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">args</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;clickEvent&#39;</span><span class="o">,</span> <span class="s1">&#39;warn&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                        <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">args</span><span class="o">[</span><span class="m">0</span><span class="o">]);</span>
                    <span class="o">});</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="c">//Stop the mousedown event so we can trap the selection in the editor!</span>
<span class="c"></span>                <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">});</span>
                <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">});</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">ie</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">//Add a couple of new events for IE</span>
<span class="c"></span>                <span class="nx">tmp</span><span class="o">.</span><span class="nx">DOM_EVENTS</span><span class="o">.</span><span class="nx">focusin</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                <span class="nx">tmp</span><span class="o">.</span><span class="nx">DOM_EVENTS</span><span class="o">.</span><span class="nx">focusout</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
                
                <span class="c">//Stop them so we don&#39;t loose focus in the Editor</span>
<span class="c"></span>                <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;focusin&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">},</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                
                <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;focusout&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">},</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
                <span class="nx">tmp</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">},</span> <span class="nx">oButton</span><span class="o">,</span> <span class="k">this</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">.</span><span class="nx">webkit</span><span class="o">)</span> <span class="o">{</span>
                <span class="c">//This will keep the document from gaining focus and the editor from loosing it..</span>
<span class="c"></span>                <span class="c">//Forcefully remove the focus calls in button!</span>
<span class="c"></span>                <span class="nx">tmp</span><span class="o">.</span><span class="nx">hasFocus</span> <span class="o">=</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
                <span class="o">};</span>
            <span class="o">}</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">((</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;menu&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;split&#39;</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;select&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isArray</span><span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Button type is (&#39;</span> <span class="o">+</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">+</span> <span class="s1">&#39;), doing extra renderer work.&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                    <span class="k">var</span> <span class="nx">menu</span> <span class="o">=</span> <span class="nx">tmp</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">();</span>
                    <span class="nx">menu</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">_addMenuClasses</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">renderer</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">menu</span><span class="o">.</span><span class="nx">renderEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="nx">oButton</span><span class="o">.</span><span class="nx">renderer</span><span class="o">,</span> <span class="nx">tmp</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">oButton</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method addSeparator</span>
<span class="c">        * @description Add a new button separator to the toolbar.</span>
<span class="c">        * @param {HTMLElement} cont Optional HTML element to insert this button into.</span>
<span class="c">        * @param {HTMLElement} after Optional HTML element to insert this button after in the DOM.</span>
<span class="c">        */</span>
        <span class="nx">addSeparator</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">cont</span><span class="o">,</span> <span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;addSeparator&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">sepCont</span> <span class="o">=</span> <span class="o">((</span><span class="nx">cont</span><span class="o">)</span> <span class="o">?</span> <span class="nx">cont</span> <span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">));</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">_queue</span><span class="o">.</span><span class="nx">length</span><span class="o">]</span> <span class="o">=</span> <span class="o">[</span><span class="s1">&#39;addSeparator&#39;</span><span class="o">,</span> <span class="nx">arguments</span><span class="o">];</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_sepCount</span> <span class="o">===</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_sepCount</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_sep</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Separator does not yet exist, creating&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_sep</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;SPAN&#39;</span><span class="o">);</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_sep</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_SEPARATOR</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_sep</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;|&#39;</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;Separator does exist, cloning&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">_sep</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sep</span><span class="o">.</span><span class="nx">cloneNode</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">_sepCount</span><span class="o">++;</span>
            <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">_sep</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">CLASS_SEPARATOR</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_sepCount</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">nextSib</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">.</span><span class="nx">get</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">nextSib</span> <span class="o">=</span> <span class="nx">after</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">nextSibling</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">after</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">nextSib</span> <span class="o">=</span> <span class="nx">after</span><span class="o">.</span><span class="nx">nextSibling</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">nextSib</span> <span class="o">=</span> <span class="nx">after</span><span class="o">;</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">nextSib</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">nextSib</span> <span class="o">==</span> <span class="nx">after</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">nextSib</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_sep</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="nx">nextSib</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">insertBefore</span><span class="o">(</span><span class="nx">_sep</span><span class="o">,</span> <span class="nx">nextSib</span><span class="o">);</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="nx">sepCont</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_sep</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="nx">_sep</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method _createColorPicker</span>
<span class="c">        * @private</span>
<span class="c">        * @description Creates the core DOM reference to the color picker menu item.</span>
<span class="c">        * @param {String} id the id of the toolbar to prefix this DOM container with.</span>
<span class="c">        */</span>
        <span class="nx">_createColorPicker</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_colors&#39;</span><span class="o">))</span> <span class="o">{</span>
               <span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_colors&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">Dom</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_colors&#39;</span><span class="o">));</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">picker</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;div&#39;</span><span class="o">);</span>
            <span class="nx">picker</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;yui-toolbar-colors&#39;</span><span class="o">;</span>
            <span class="nx">picker</span><span class="o">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;_colors&#39;</span><span class="o">;</span>
            <span class="nx">picker</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="o">;</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nb">window</span><span class="o">,</span> <span class="s1">&#39;load&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nb">document</span><span class="o">.</span><span class="nx">body</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">picker</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

            <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span> <span class="o">=</span> <span class="nx">picker</span><span class="o">;</span>

            <span class="k">var</span> <span class="nx">html</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorData</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_colorData</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">html</span> <span class="o">+=</span> <span class="s1">&#39;&lt;a style=&quot;background-color: &#39;</span> <span class="o">+</span> <span class="nx">i</span> <span class="o">+</span> <span class="s1">&#39;&quot; href=&quot;#&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">i</span><span class="o">.</span><span class="nx">replace</span><span class="o">(</span><span class="s1">&#39;#&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;&lt;/a&gt;&#39;</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="nx">html</span> <span class="o">+=</span> <span class="s1">&#39;&lt;span&gt;&lt;em&gt;X&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&#39;</span><span class="o">;</span>
            <span class="nx">picker</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">html</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">em</span> <span class="o">=</span> <span class="nx">picker</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;em&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
            <span class="k">var</span> <span class="nx">strong</span> <span class="o">=</span> <span class="nx">picker</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;strong&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>

            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">picker</span><span class="o">,</span> <span class="s1">&#39;mouseover&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">tar</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;a&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">em</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">backgroundColor</span> <span class="o">=</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">backgroundColor</span><span class="o">;</span>
                    <span class="nx">strong</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorData</span><span class="o">[</span><span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">]</span> <span class="o">+</span> <span class="s1">&#39;&lt;br&gt;&#39;</span> <span class="o">+</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">picker</span><span class="o">,</span> <span class="s1">&#39;focus&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">});</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">picker</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">});</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">picker</span><span class="o">,</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">var</span> <span class="nx">tar</span> <span class="o">=</span> <span class="nx">Event</span><span class="o">.</span><span class="nx">getTarget</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">tar</span><span class="o">.</span><span class="nx">tagName</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="s1">&#39;a&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;colorPickerClicked&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;colorPickerClicked&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">,</span> <span class="nx">button</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">_button</span><span class="o">,</span> <span class="nx">color</span><span class="o">:</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">,</span> <span class="nx">colorName</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorData</span><span class="o">[</span><span class="s1">&#39;#&#39;</span> <span class="o">+</span> <span class="nx">tar</span><span class="o">.</span><span class="nx">innerHTML</span><span class="o">]</span> <span class="o">}</span> <span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">_button</span><span class="o">).</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">hide</span><span class="o">();</span>
                <span class="o">}</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method _resetColorPicker</span>
<span class="c">        * @private</span>
<span class="c">        * @description Clears the currently selected color or mouseover color in the color picker.</span>
<span class="c">        */</span>
        <span class="nx">_resetColorPicker</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">em</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;em&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
            <span class="k">var</span> <span class="nx">strong</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">getElementsByTagName</span><span class="o">(</span><span class="s1">&#39;strong&#39;</span><span class="o">)[</span><span class="m">0</span><span class="o">];</span>
            <span class="nx">em</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">backgroundColor</span> <span class="o">=</span> <span class="s1">&#39;transparent&#39;</span><span class="o">;</span>
            <span class="nx">strong</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method _makeColorButton</span>
<span class="c">        * @private</span>
<span class="c">        * @description Called to turn a &quot;color&quot; button into a menu button with an Overlay for the menu.</span>
<span class="c">        * @param {Object} _oButton &lt;a href=&quot;YAHOO.widget.Button.html&quot;&gt;YAHOO.widget.Button&lt;/a&gt; reference</span>
<span class="c">        */</span>
        <span class="nx">_makeColorButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">_oButton</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">)</span> <span class="o">{</span>   
                <span class="k">this</span><span class="o">.</span><span class="nx">_createColorPicker</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">));</span>
            <span class="o">}</span>
            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;color&#39;</span><span class="o">;</span>
            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Overlay</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;_&#39;</span> <span class="o">+</span> <span class="nx">_oButton</span><span class="o">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;_menu&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">visbile</span><span class="o">:</span> <span class="kc">false</span><span class="o">,</span> <span class="nx">position</span><span class="o">:</span> <span class="s1">&#39;absolute&#39;</span> <span class="o">});</span>
            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">setBody</span><span class="o">(</span><span class="s1">&#39;&#39;</span><span class="o">);</span>
            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">render</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">));</span>
            <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">beforeShowEvent</span><span class="o">.</span><span class="nx">subscribe</span><span class="o">(</span><span class="k">function</span><span class="o">()</span> <span class="o">{</span>
                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;zindex&#39;</span><span class="o">,</span> <span class="m">5</span><span class="o">);</span> <span class="c">//Re Adjust the overlays zIndex.. not sure why.</span>
<span class="c"></span>                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;context&#39;</span><span class="o">,</span> <span class="o">[</span><span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">_oButton</span><span class="o">.</span><span class="nx">id</span><span class="o">).</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="s1">&#39;tl&#39;</span><span class="o">,</span> <span class="s1">&#39;bl&#39;</span><span class="o">]);</span> <span class="c">//Re Adjust the overlay.. not sure why.</span>
<span class="c"></span>                <span class="c">//Move the DOM reference of the color picker to the Overlay that we are about to show.</span>
<span class="c"></span>                <span class="k">this</span><span class="o">.</span><span class="nx">_resetColorPicker</span><span class="o">();</span>
                <span class="k">var</span> <span class="nx">_p</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">_p</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">)</span> <span class="o">{</span>
                    <span class="c">//if (_p.parentNode != _oButton.menu.body) {</span>
<span class="c"></span>                        <span class="nx">_p</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">removeChild</span><span class="o">(</span><span class="nx">_p</span><span class="o">);</span>
                    <span class="c">//}</span>
<span class="c"></span>                <span class="o">}</span>
                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">setBody</span><span class="o">(</span><span class="s1">&#39;&#39;</span><span class="o">);</span>
                <span class="nx">_oButton</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">appendToBody</span><span class="o">(</span><span class="nx">_p</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">_colorPicker</span><span class="o">.</span><span class="nx">style</span><span class="o">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;block&#39;</span><span class="o">;</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="k">return</span> <span class="nx">_oButton</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @private</span>
<span class="c">        * @method _makeSpinButton</span>
<span class="c">        * @description Create a button similar to an OS Spin button.. It has an up/down arrow combo to scroll through a range of int values.</span>
<span class="c">        * @param {Object} _button &lt;a href=&quot;YAHOO.widget.Button.html&quot;&gt;YAHOO.widget.Button&lt;/a&gt; reference</span>
<span class="c">        * @param {Object} oButton Object literal containing the buttons initial config</span>
<span class="c">        */</span>
        <span class="nx">_makeSpinButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">_button</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">)</span> <span class="o">{</span>
            <span class="nx">_button</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">CLASS_PREFIX</span> <span class="o">+</span> <span class="s1">&#39;-spinbutton&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="o">,</span>
                <span class="nx">_par</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">_button</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">.</span><span class="nx">parentNode</span><span class="o">,</span> <span class="c">//parentNode of Button Element for appending child</span>
<span class="c"></span>                <span class="nx">range</span> <span class="o">=</span> <span class="nx">oButton</span><span class="o">.</span><span class="nx">range</span><span class="o">,</span>
                <span class="nx">_b1</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">),</span>
                <span class="nx">_b2</span> <span class="o">=</span> <span class="nb">document</span><span class="o">.</span><span class="nx">createElement</span><span class="o">(</span><span class="s1">&#39;a&#39;</span><span class="o">);</span>
                <span class="nx">_b1</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span><span class="o">;</span>
                <span class="nx">_b2</span><span class="o">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;#&#39;</span><span class="o">;</span>
            
            <span class="c">//Setup the up and down arrows</span>
<span class="c"></span>            <span class="nx">_b1</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;up&#39;</span><span class="o">;</span>
            <span class="nx">_b1</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_UP</span><span class="o">;</span>
            <span class="nx">_b1</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_UP</span><span class="o">;</span>
            <span class="nx">_b2</span><span class="o">.</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;down&#39;</span><span class="o">;</span>
            <span class="nx">_b2</span><span class="o">.</span><span class="nx">title</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_DOWN</span><span class="o">;</span>
            <span class="nx">_b2</span><span class="o">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_DOWN</span><span class="o">;</span>

            <span class="c">//Append them to the container</span>
<span class="c"></span>            <span class="nx">_par</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_b1</span><span class="o">);</span>
            <span class="nx">_par</span><span class="o">.</span><span class="nx">appendChild</span><span class="o">(</span><span class="nx">_b2</span><span class="o">);</span>
            
            <span class="k">var</span> <span class="k">label</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">substitute</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_LABEL</span><span class="o">,</span> <span class="o">{</span> <span class="nx">VALUE</span><span class="o">:</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">});</span>
            <span class="nx">_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">);</span>

            <span class="k">var</span> <span class="nx">cleanVal</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="o">((</span><span class="nx">value</span> <span class="o">&lt;</span> <span class="nx">range</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">?</span> <span class="nx">range</span><span class="o">[</span><span class="m">0</span><span class="o">]</span> <span class="o">:</span> <span class="nx">value</span><span class="o">);</span>
                <span class="nx">value</span> <span class="o">=</span> <span class="o">((</span><span class="nx">value</span> <span class="o">&gt;</span> <span class="nx">range</span><span class="o">[</span><span class="m">1</span><span class="o">])</span> <span class="o">?</span> <span class="nx">range</span><span class="o">[</span><span class="m">1</span><span class="o">]</span> <span class="o">:</span> <span class="nx">value</span><span class="o">);</span>
                <span class="k">return</span> <span class="nx">value</span><span class="o">;</span>
            <span class="o">};</span>

            <span class="k">var</span> <span class="nx">br</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">browser</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">tbar</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
            <span class="k">var</span> <span class="nx">strLabel</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">STR_SPIN_LABEL</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">tbar</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">.</span><span class="nx">firstChild</span><span class="o">;</span>
            <span class="o">}</span>
            
            <span class="k">var</span> <span class="nx">_intUp</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">!=</span> <span class="m">9</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
                    <span class="nx">value</span><span class="o">++;</span>
                    <span class="nx">value</span> <span class="o">=</span> <span class="nx">cleanVal</span><span class="o">(</span><span class="nx">value</span><span class="o">);</span>
                    <span class="nx">_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nx">value</span><span class="o">);</span>
                    <span class="k">var</span> <span class="k">label</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">substitute</span><span class="o">(</span><span class="nx">strLabel</span><span class="o">,</span> <span class="o">{</span> <span class="nx">VALUE</span><span class="o">:</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">});</span>
                    <span class="nx">_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">br</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="nx">tbar</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed</span>
<span class="c"></span>                        <span class="c">//_button.focus();</span>
<span class="c"></span>                    <span class="o">}</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">_buttonClick</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">};</span>

            <span class="k">var</span> <span class="nx">_intDown</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">util</span><span class="o">.</span><span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(!</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">)</span> <span class="o">&amp;&amp;</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">!=</span> <span class="m">9</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="nb">parseInt</span><span class="o">(</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">),</span> <span class="m">10</span><span class="o">);</span>
                    <span class="nx">value</span><span class="o">--;</span>
                    <span class="nx">value</span> <span class="o">=</span> <span class="nx">cleanVal</span><span class="o">(</span><span class="nx">value</span><span class="o">);</span>

                    <span class="nx">_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&#39;</span><span class="o">+</span><span class="nx">value</span><span class="o">);</span>
                    <span class="k">var</span> <span class="k">label</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">lang</span><span class="o">.</span><span class="nx">substitute</span><span class="o">(</span><span class="nx">strLabel</span><span class="o">,</span> <span class="o">{</span> <span class="nx">VALUE</span><span class="o">:</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">)</span> <span class="o">});</span>
                    <span class="nx">_button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;title&#39;</span><span class="o">,</span> <span class="k">label</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(!</span><span class="nx">br</span><span class="o">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="nx">tbar</span><span class="o">)</span> <span class="o">{</span>
                        <span class="c">//tbar.focus(); //We do this for accessibility, on the re-focus of the element, a screen reader will re-read the title that was just changed</span>
<span class="c"></span>                        <span class="c">//_button.focus();</span>
<span class="c"></span>                    <span class="o">}</span>
                    <span class="nx">self</span><span class="o">.</span><span class="nx">_buttonClick</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">oButton</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">};</span>

            <span class="k">var</span> <span class="nx">_intKeyUp</span> <span class="o">=</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">38</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_intUp</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">40</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">_intDown</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">107</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">{</span>  <span class="c">//Plus Key</span>
<span class="c"></span>                    <span class="nx">_intUp</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">109</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">shiftKey</span><span class="o">)</span> <span class="o">{</span>  <span class="c">//Minus Key</span>
<span class="c"></span>                    <span class="nx">_intDown</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">};</span>

            <span class="c">//Handle arrow keys..</span>
<span class="c"></span>            <span class="nx">_button</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="s1">&#39;keydown&#39;</span><span class="o">,</span> <span class="nx">_intKeyUp</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>

            <span class="c">//Listen for the click on the up button and act on it</span>
<span class="c"></span>            <span class="c">//Listen for the click on the down button and act on it</span>
<span class="c"></span>            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">_b1</span><span class="o">,</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">,</span><span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">_b2</span><span class="o">,</span> <span class="s1">&#39;mousedown&#39;</span><span class="o">,</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">},</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">_b1</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="nx">_intUp</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="nx">Event</span><span class="o">.</span><span class="nx">on</span><span class="o">(</span><span class="nx">_b2</span><span class="o">,</span> <span class="s1">&#39;click&#39;</span><span class="o">,</span> <span class="nx">_intDown</span><span class="o">,</span> <span class="k">this</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @protected</span>
<span class="c">        * @method _buttonClick</span>
<span class="c">        * @description Click handler for all buttons in the toolbar.</span>
<span class="c">        * @param {String} ev The event that was passed in.</span>
<span class="c">        * @param {Object} info Object literal of information about the button that was clicked.</span>
<span class="c">        */</span>
        <span class="nx">_buttonClick</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">ev</span><span class="o">,</span> <span class="nx">info</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">doEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">;</span>
            
            <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span> <span class="o">&amp;&amp;</span> <span class="nx">ev</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;keypress&#39;</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="m">9</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">doEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">((</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="m">13</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="m">0</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">ev</span><span class="o">.</span><span class="nx">keyCode</span> <span class="o">===</span> <span class="m">32</span><span class="o">))</span> <span class="o">{</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="nx">doEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>

            <span class="k">if</span> <span class="o">(</span><span class="nx">doEvent</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">fireNextEvent</span> <span class="o">=</span> <span class="kc">true</span><span class="o">,</span>
                    <span class="nx">retValue</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;fireEvent::&#39;</span> <span class="o">+</span> <span class="nx">info</span><span class="o">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                    <span class="nx">retValue</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">info</span><span class="o">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="nx">button</span><span class="o">:</span> <span class="nx">info</span> <span class="o">});</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">retValue</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">fireNextEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                
                <span class="k">if</span> <span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">&amp;&amp;</span> <span class="nx">fireNextEvent</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;fireEvent::&#39;</span> <span class="o">+</span> <span class="nx">info</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                    <span class="nx">retValue</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="nx">info</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">+</span> <span class="s1">&#39;Click&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="nx">button</span><span class="o">:</span> <span class="nx">info</span> <span class="o">});</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">retValue</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span>
                        <span class="nx">fireNextEvent</span> <span class="o">=</span> <span class="kc">false</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">fireNextEvent</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">log</span><span class="o">(</span><span class="s1">&#39;fireEvent::buttonClick&#39;</span><span class="o">,</span> <span class="s1">&#39;info&#39;</span><span class="o">,</span> <span class="s1">&#39;Toolbar&#39;</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;buttonClick&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;buttonClick&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">),</span> <span class="nx">button</span><span class="o">:</span> <span class="nx">info</span> <span class="o">});</span>
                <span class="o">}</span>

                <span class="k">if</span> <span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;select&#39;</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">id</span><span class="o">);</span>
                    <span class="k">var</span> <span class="nx">txt</span> <span class="o">=</span> <span class="nx">info</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">info</span><span class="o">.</span><span class="nx">menu</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">info</span><span class="o">.</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                            <span class="nx">txt</span> <span class="o">=</span> <span class="nx">info</span><span class="o">.</span><span class="nx">menu</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">text</span><span class="o">;</span>
                            <span class="k">break</span><span class="o">;</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                    <span class="nx">button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-&#39;</span> <span class="o">+</span> <span class="nx">info</span><span class="o">.</span><span class="nx">menucmd</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">info</span><span class="o">.</span><span class="nx">value</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">txt</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">);</span>
                    <span class="k">var</span> <span class="nx">_items</span> <span class="o">=</span> <span class="nx">button</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">getItems</span><span class="o">();</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">m</span> <span class="o">&lt;</span> <span class="nx">_items</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">m</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">value</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">==</span> <span class="nx">info</span><span class="o">.</span><span class="nx">value</span><span class="o">.</span><span class="nx">toLowerCase</span><span class="o">())</span> <span class="o">{</span>
                            <span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                        <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                            <span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">ev</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Event</span><span class="o">.</span><span class="nx">stopEvent</span><span class="o">(</span><span class="nx">ev</span><span class="o">);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getButtonById</span>
<span class="c">        * @description Gets a button instance from the toolbar by is Dom id.</span>
<span class="c">        * @param {String} id The Dom id to query for.</span>
<span class="c">        * @return {&lt;a href=&quot;YAHOO.widget.Button.html&quot;&gt;YAHOO.widget.Button&lt;/a&gt;}</span>
<span class="c">        */</span>
        <span class="nx">getButtonById</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getButtonByValue</span>
<span class="c">        * @description Gets a button instance or a menuitem instance from the toolbar by it&#39;s value.</span>
<span class="c">        * @param {String} value The button value to query for.</span>
<span class="c">        * @return {&lt;a href=&quot;YAHOO.widget.Button.html&quot;&gt;YAHOO.widget.Button&lt;/a&gt; or &lt;a href=&quot;YAHOO.widget.MenuItem.html&quot;&gt;YAHOO.widget.MenuItem&lt;/a&gt;}</span>
<span class="c">        */</span>
        <span class="nx">getButtonByValue</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">_buttons</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;buttons&#39;</span><span class="o">);</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">_buttons</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">group</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="o">)</span> <span class="o">{</span>
                    <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">m</span> <span class="o">&lt;</span> <span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">m</span><span class="o">++)</span> <span class="o">{</span>
                        <span class="k">if</span> <span class="o">((</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">menucmd</span> <span class="o">==</span> <span class="nx">value</span><span class="o">))</span> <span class="o">{</span>
                            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">id</span><span class="o">);</span>
                        <span class="o">}</span>
                        <span class="k">if</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">menu</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Menu Button, loop through the values</span>
<span class="c"></span>                            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">s</span> <span class="o">&lt;</span> <span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">menu</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">s</span><span class="o">++)</span> <span class="o">{</span>
                                <span class="k">if</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">menu</span><span class="o">[</span><span class="nx">s</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                                    <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">buttons</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">id</span><span class="o">);</span>
                                <span class="o">}</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">((</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">||</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">menucmd</span> <span class="o">==</span> <span class="nx">value</span><span class="o">))</span> <span class="o">{</span>
                        <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">id</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">menu</span><span class="o">)</span> <span class="o">{</span> <span class="c">//Menu Button, loop through the values</span>
<span class="c"></span>                        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">j</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">menu</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">j</span><span class="o">++)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">menu</span><span class="o">[</span><span class="nx">j</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                                <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">_buttons</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">id</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getButtonByIndex</span>
<span class="c">        * @description Gets a button instance from the toolbar by is index in _buttonList.</span>
<span class="c">        * @param {Number} index The index of the button in _buttonList.</span>
<span class="c">        * @return {&lt;a href=&quot;YAHOO.widget.Button.html&quot;&gt;YAHOO.widget.Button&lt;/a&gt;}</span>
<span class="c">        */</span>
        <span class="nx">getButtonByIndex</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">index</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">index</span><span class="o">])</span> <span class="o">{</span>
                <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">index</span><span class="o">];</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method getButtons</span>
<span class="c">        * @description Returns an array of buttons in the current toolbar</span>
<span class="c">        * @return {Array}</span>
<span class="c">        */</span>
        <span class="nx">getButtons</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method disableButton</span>
<span class="c">        * @description Disables a button in the toolbar.</span>
<span class="c">        * @param {String/Number} id Disable a button by it&#39;s id, index or value.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">disableButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByIndex</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method enableButton</span>
<span class="c">        * @description Enables a button in the toolbar.</span>
<span class="c">        * @param {String/Number} id Enable a button by it&#39;s id, index or value.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">enableButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByIndex</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method selectButton</span>
<span class="c">        * @description Selects a button in the toolbar.</span>
<span class="c">        * @param {String/Number} id Select a button by it&#39;s id, index or value.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">selectButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">,</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByIndex</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(!(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">))</span> <span class="o">{</span>
                    <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">)</span> <span class="o">{</span>
                    <span class="nx">button</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="s1">&#39;yui-button-selected&#39;</span><span class="o">);</span>
                    <span class="nx">button</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="s1">&#39;yui-button-&#39;</span> <span class="o">+</span> <span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-selected&#39;</span><span class="o">);</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">var</span> <span class="nx">_items</span> <span class="o">=</span> <span class="nx">button</span><span class="o">.</span><span class="nx">getMenu</span><span class="o">().</span><span class="nx">getItems</span><span class="o">();</span>
                        <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">m</span> <span class="o">&lt;</span> <span class="nx">_items</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span> <span class="nx">m</span><span class="o">++)</span> <span class="o">{</span>
                            <span class="k">if</span> <span class="o">(</span><span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">value</span><span class="o">)</span> <span class="o">{</span>
                                <span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">true</span><span class="o">);</span>
                                <span class="nx">button</span><span class="o">.</span><span class="nx">set</span><span class="o">(</span><span class="s1">&#39;label&#39;</span><span class="o">,</span> <span class="s1">&#39;&lt;span class=&quot;yui-toolbar-&#39;</span> <span class="o">+</span> <span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-&#39;</span> <span class="o">+</span> <span class="o">(</span><span class="nx">value</span><span class="o">).</span><span class="nx">replace</span><span class="o">(</span><span class="sr">/ /g</span><span class="o">,</span> <span class="s1">&#39;-&#39;</span><span class="o">).</span><span class="nx">toLowerCase</span><span class="o">()</span> <span class="o">+</span> <span class="s1">&#39;&quot;&gt;&#39;</span> <span class="o">+</span> <span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">_oText</span><span class="o">.</span><span class="nx">nodeValue</span> <span class="o">+</span> <span class="s1">&#39;&lt;/span&gt;&#39;</span><span class="o">);</span>
                            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                                <span class="nx">_items</span><span class="o">[</span><span class="nx">m</span><span class="o">].</span><span class="nx">cfg</span><span class="o">.</span><span class="nx">setProperty</span><span class="o">(</span><span class="s1">&#39;checked&#39;</span><span class="o">,</span> <span class="kc">false</span><span class="o">);</span>
                            <span class="o">}</span>
                        <span class="o">}</span>
                    <span class="o">}</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method deselectButton</span>
<span class="c">        * @description Deselects a button in the toolbar.</span>
<span class="c">        * @param {String/Number} id Deselect a button by it&#39;s id, index or value.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">deselectButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByIndex</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">button</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="s1">&#39;yui-button-selected&#39;</span><span class="o">);</span>
                <span class="nx">button</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="s1">&#39;yui-button-&#39;</span> <span class="o">+</span> <span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;value&#39;</span><span class="o">)</span> <span class="o">+</span> <span class="s1">&#39;-selected&#39;</span><span class="o">);</span>
                <span class="nx">button</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="s1">&#39;yui-button-hover&#39;</span><span class="o">);</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method deselectAllButtons</span>
<span class="c">        * @description Deselects all buttons in the toolbar.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">deselectAllButtons</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">deselectButton</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method disableAllButtons</span>
<span class="c">        * @description Disables all buttons in the toolbar.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">disableAllButtons</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method enableAllButtons</span>
<span class="c">        * @description Enables all buttons in the toolbar.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">enableAllButtons</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">]);</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method resetAllButtons</span>
<span class="c">        * @description Resets all buttons to their initial state.</span>
<span class="c">        * @param {Object} _ex Except these buttons</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">resetAllButtons</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">_ex</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">if</span> <span class="o">(!</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isObject</span><span class="o">(</span><span class="nx">_ex</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">_ex</span> <span class="o">=</span> <span class="o">{};</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;disabled&#39;</span><span class="o">))</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>
            <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">_button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">];</span>
                <span class="k">var</span> <span class="nx">disabled</span> <span class="o">=</span> <span class="nx">_button</span><span class="o">.</span><span class="nx">_configs</span><span class="o">.</span><span class="nx">disabled</span><span class="o">.</span><span class="nx">_initialConfig</span><span class="o">.</span><span class="nx">value</span><span class="o">;</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">_ex</span><span class="o">[</span><span class="nx">_button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)])</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">selectButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="nx">disabled</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">disableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                    <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">enableButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                    <span class="o">}</span>
                    <span class="k">this</span><span class="o">.</span><span class="nx">deselectButton</span><span class="o">(</span><span class="nx">_button</span><span class="o">);</span>
                <span class="o">}</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method destroyButton</span>
<span class="c">        * @description Destroy a button in the toolbar.</span>
<span class="c">        * @param {String/Number} id Destroy a button by it&#39;s id or index.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">destroyButton</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">id</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">button</span> <span class="o">=</span> <span class="nx">id</span><span class="o">;</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isString</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonById</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">isNumber</span><span class="o">(</span><span class="nx">id</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByIndex</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(!(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">))</span> <span class="o">{</span>
                <span class="nx">button</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">getButtonByValue</span><span class="o">(</span><span class="nx">id</span><span class="o">);</span>
            <span class="o">}</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">button</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="o">.</span><span class="nx">widget</span><span class="o">.</span><span class="nx">Button</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">var</span> <span class="nx">thisID</span> <span class="o">=</span> <span class="nx">button</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">);</span>
                <span class="nx">button</span><span class="o">.</span><span class="nx">destroy</span><span class="o">();</span>

                <span class="k">var</span> <span class="nx">len</span> <span class="o">=</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span><span class="o">;</span>
                <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="m">0</span><span class="o">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="o">;</span> <span class="nx">i</span><span class="o">++)</span> <span class="o">{</span>
                    <span class="k">if</span> <span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">].</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;id&#39;</span><span class="o">)</span> <span class="o">==</span> <span class="nx">thisID</span><span class="o">)</span> <span class="o">{</span>
                        <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                    <span class="o">}</span>
                <span class="o">}</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="o">;</span>
            <span class="o">}</span>

        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method destroy</span>
<span class="c">        * @description Destroys the toolbar, all of it&#39;s elements and objects.</span>
<span class="c">        * @return {Boolean}</span>
<span class="c">        */</span>
        <span class="nx">destroy</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">className</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">;</span>
            <span class="c">//Brutal Object Destroy</span>
<span class="c"></span>            <span class="k">for</span> <span class="o">(</span><span class="k">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="o">)</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">Lang</span><span class="o">.</span><span class="nx">hasOwnProperty</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="nx">i</span><span class="o">))</span> <span class="o">{</span>
                    <span class="k">this</span><span class="o">[</span><span class="nx">i</span><span class="o">]</span> <span class="o">=</span> <span class="kc">null</span><span class="o">;</span>
                <span class="o">}</span>
            <span class="o">}</span>
            <span class="k">return</span> <span class="kc">true</span><span class="o">;</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method collapse</span>
<span class="c">        * @description Programatically collapse the toolbar.</span>
<span class="c">        * @param {Boolean} collapse True to collapse, false to expand.</span>
<span class="c">        */</span>
        <span class="nx">collapse</span><span class="o">:</span> <span class="k">function</span><span class="o">(</span><span class="nx">collapse</span><span class="o">)</span> <span class="o">{</span>
            <span class="k">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="o">.</span><span class="nx">getElementsByClassName</span><span class="o">(</span><span class="s1">&#39;collapse&#39;</span><span class="o">,</span> <span class="s1">&#39;span&#39;</span><span class="o">,</span> <span class="k">this</span><span class="o">.</span><span class="nx">_titlebar</span><span class="o">);</span>
            <span class="k">if</span> <span class="o">(</span><span class="nx">collapse</span> <span class="o">===</span> <span class="kc">false</span><span class="o">)</span> <span class="o">{</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-container-collapsed&#39;</span><span class="o">);</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">removeClass</span><span class="o">(</span><span class="nx">el</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;collapsed&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;toolbarExpanded&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;toolbarExpanded&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
                <span class="k">if</span> <span class="o">(</span><span class="nx">el</span><span class="o">[</span><span class="m">0</span><span class="o">])</span> <span class="o">{</span>
                    <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="nx">el</span><span class="o">[</span><span class="m">0</span><span class="o">],</span> <span class="s1">&#39;collapsed&#39;</span><span class="o">);</span>
                <span class="o">}</span>
                <span class="nx">Dom</span><span class="o">.</span><span class="nx">addClass</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;cont&#39;</span><span class="o">).</span><span class="nx">parentNode</span><span class="o">,</span> <span class="s1">&#39;yui-toolbar-container-collapsed&#39;</span><span class="o">);</span>
                <span class="k">this</span><span class="o">.</span><span class="nx">fireEvent</span><span class="o">(</span><span class="s1">&#39;toolbarCollapsed&#39;</span><span class="o">,</span> <span class="o">{</span> <span class="nx">type</span><span class="o">:</span> <span class="s1">&#39;toolbarCollapsed&#39;</span><span class="o">,</span> <span class="nx">target</span><span class="o">:</span> <span class="k">this</span> <span class="o">});</span>
            <span class="o">}</span>
        <span class="o">},</span>
        <span class="c">/**</span>
<span class="c">        * @method toString</span>
<span class="c">        * @description Returns a string representing the toolbar.</span>
<span class="c">        * @return {String}</span>
<span class="c">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="k">function</span><span class="o">()</span> <span class="o">{</span>
            <span class="k">return</span> <span class="s1">&#39;Toolbar (#&#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">get</span><span class="o">(</span><span class="s1">&#39;element&#39;</span><span class="o">).</span><span class="nx">id</span> <span class="o">+</span> <span class="s1">&#39;) with &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="o">.</span><span class="nx">_buttonList</span><span class="o">.</span><span class="nx">length</span> <span class="o">+</span> <span class="s1">&#39; buttons.&#39;</span><span class="o">;</span>
        <span class="o">}</span>
    <span class="o">});</span>
<span class="c">/**</span>
<span class="c">* @event buttonClick</span>
<span class="c">* @param {Object} o The object passed to this handler is the button config used to create the button.</span>
<span class="c">* @description Fires when any botton receives a click event. Passes back a single object representing the buttons config object. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event valueClick</span>
<span class="c">* @param {Object} o The object passed to this handler is the button config used to create the button.</span>
<span class="c">* @description This is a special dynamic event that is created and dispatched based on the value property</span>
<span class="c">* of the button config. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* Example:</span>
<span class="c">* &lt;code&gt;&lt;pre&gt;</span>
<span class="c">* buttons : [</span>
<span class="c">*   { type: &#39;button&#39;, value: &#39;test&#39;, value: &#39;testButton&#39; }</span>
<span class="c">* ]&lt;/pre&gt;</span>
<span class="c">* &lt;/code&gt;</span>
<span class="c">* With the valueClick event you could subscribe to this buttons click event with this:</span>
<span class="c">* tbar.in(&#39;testButtonClick&#39;, function() { alert(&#39;test button clicked&#39;); })</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event toolbarExpanded</span>
<span class="c">* @description Fires when the toolbar is expanded via the collapse button. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="c">/**</span>
<span class="c">* @event toolbarCollapsed</span>
<span class="c">* @description Fires when the toolbar is collapsed via the collapse button. See &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for more information on listening for this event.</span>
<span class="c">* @type YAHOO.util.CustomEvent</span>
<span class="c">*/</span>
<span class="o">})();</span>
</pre></div>
                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div class="module">
                        <h4>Modules</h4>
                        <ul class="content">

                                <li class=""><a href="module_animation.html">animation</a></li>

                                <li class=""><a href="module_autocomplete.html">autocomplete</a></li>

                                <li class=""><a href="module_button.html">button</a></li>

                                <li class=""><a href="module_calendar.html">calendar</a></li>

                                <li class=""><a href="module_colorpicker.html">colorpicker</a></li>

                                <li class=""><a href="module_connection.html">connection</a></li>

                                <li class=""><a href="module_container.html">container</a></li>

                                <li class=""><a href="module_datasource.html">datasource</a></li>

                                <li class=""><a href="module_datatable.html">datatable</a></li>

                                <li class=""><a href="module_dom.html">dom</a></li>

                                <li class=""><a href="module_dragdrop.html">dragdrop</a></li>

                                <li class="selected"><a href="module_editor.html">editor</a></li>

                                <li class=""><a href="module_element.html">element</a></li>

                                <li class=""><a href="module_event.html">event</a></li>

                                <li class=""><a href="module_history.html">history</a></li>

                                <li class=""><a href="module_imageloader.html">imageloader</a></li>

                                <li class=""><a href="module_logger.html">logger</a></li>

                                <li class=""><a href="module_menu.html">menu</a></li>

                                <li class=""><a href="module_slider.html">slider</a></li>

                                <li class=""><a href="module_tabview.html">tabview</a></li>

                                <li class=""><a href="module_treeview.html">treeview</a></li>

                                <li class=""><a href="module_yahoo.html">yahoo</a></li>

                                <li class=""><a href="module_yuiloader.html">yuiloader</a></li>

                                <li class=""><a href="module_yuitest.html">yuitest</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.Editor.html">YAHOO.widget.Editor</a></li>
                                <li class=""><a href="YAHOO.widget.EditorInfo.html">YAHOO.widget.EditorInfo</a></li>
                                <li class=""><a href="YAHOO.widget.EditorWindow.html">YAHOO.widget.EditorWindow</a></li>
                                <li class=""><a href="YAHOO.widget.Toolbar.html">YAHOO.widget.Toolbar</a></li>
                        </ul>
                    </div>

                    <div class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="editor.js.html">editor.js</a></li>
                                <li class="selected"><a href="toolbar.js.html">toolbar.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2007 Yahoo! Inc. All rights reserved.
	</div>
</div>
</body>
</html>
